package com.min.controller;


import com.min.domain.WorldNews;
import com.min.domain.journalismType;
import com.min.domain.sina;

import com.min.service.JournalismTypeService;
import com.min.service.SinaService;
import com.min.service.WorldNewsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;


@RestController
@RequestMapping("/wanglk_bds")
public class SinaController {

    @Autowired
    private SinaService sinaServer;
    @Autowired
    private JournalismTypeService journalismTypeService;

    @Autowired
    private WorldNewsService worldNewsService;
    //今日新闻
    @RequestMapping(value="/dayJournalism",method= RequestMethod.GET,produces="application/json")
    @ResponseBody
    public List<sina>  getnoticiashoje(){
        final List<sina> getnoticiashoje = sinaServer.getnoticiashoje();
        return  getnoticiashoje;
    }

    //热点新闻
    @RequestMapping(value="/hotNews",method= RequestMethod.GET,produces="application/json")
    @ResponseBody
    public List<sina>  gethotNews(){
        final List<sina> getnoticiashoje = sinaServer.gethotNews();
        return  getnoticiashoje;
    }


    //播报新闻占列
    @RequestMapping(value="/broadcastNews",method= RequestMethod.GET,produces="application/json")
    @ResponseBody
    public List<journalismType> getBroadcastNews(){
        final List<journalismType> broadcastNews = journalismTypeService.getBroadcastNews();
        return  broadcastNews;

    }

    //国际新闻
    @RequestMapping(value="/worldNews",method= RequestMethod.GET,produces="application/json")
    @ResponseBody
    public  List<WorldNews> getWorldNews(){
        return  worldNewsService.getWorldNews();

    }


}
